package edu.gdkm.dao;

import edu.gdkm.pojo.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentXml {
    //添加一个学生给接口加入注解配置方法sql语句实现
    @Insert("insert into tb_stu(name,sex,age) values(#{name},#{sex},#{age})")
    public void addStudent(Student student);
    //删除一个学生给接口加入注解配置方法sql语句实现
    @Delete("delete from tb_stu where id=#{id}")
    public void deleteStudent(int id);
    //修改一个学生给接口加入注解配置方法sql语句实现
    @Update("update tb_stu set name=#{name},sex=#{sex},age=#{age} where id=#{id}")
    public void updateStudent(Student student);
    //查询一个学生给接口加入注解配置方法sql语句实现
    @Select("select * from tb_stu where id=#{id}")
    public Student queryStudent(int id);

    //查询所有学生给接口加入注解配置方法sql语句实现
    @Select("select * from tb_stu")
    public default List<Student> queryAllStudent() {
        return null;
    }

    boolean delete(int i);

    boolean findAll();

    boolean update(Student 老王);

    boolean save(Student 小王);

    boolean findById(int i);
}
